function default_submit(form,input_name){
  try{
    if(form.tagName=="FORM"){
    	if(typeof(form.getAttribute("name"))=="object"){name=form.id;}else{name=form.getAttribute("name");}
	    var button =getElement(name+"_button");
  	  var submit =getElement(name+"_submit");
	    if(button){
	      button.disabled=true;
	      CheckContent(button);
	      button.form.submit();
	    }
	  }
	  if(form.tagName=="INPUT"){
	    var button=form;
	    form=form.form;
	    if(typeof(form.getAttribute("name"))=="object"){name=form.id;}else{name=form.getAttribute("name");}
      var button_yes =getElement(name+"_button_yes");
      if(button_yes){button_yes.disabled=true;}
      var button_no  =getElement(name+"_button_no");
      if(button_no){button_no.disabled=true;}
      var result =getElement(input_name+"_result");
      result.value=button.name;
      button_yes.form.submit();
	  }
    return false;
  }catch(e){
    logging("Error default_submit:"+e.message);
    return false;
  } 
}


function form_input_to_string(input){
  try{
    var string="";
    switch(input.type){
      case "text"      : {string=input.value;                               break;}
      case "textarea"  : {string=input.value;                               break;}
      case "radio"     : {string=input.checked?input.value:"";              break;}
      case "checkbox"  : {string=input.checked;                             break;}
      case "hidden"    : {string=input.value;                               break;}
      case "select-one": {string=input.options[input.selectedIndex].value;  break;}
    }
    if(string!=""){
      string=input.name+"="+string;
    }
    return string;
  }catch(e){
    logging("Error form_input_to_string:"+e.message);
    return false;
  } 
}

function form_to_string(form){
  try{
    var elements=form.elements;
    var query   ="";
    for(var i=0;i<elements.length;i++){
      var value=form_input_to_string(elements[i]);
      if(value!=""){
        query+="&"+value;
      }
    }
    return query;
  }catch(e){
    logging("Error form_to_string:"+e.message);
  } 
}
